import {createStore} from 'vuex'
import createPersistedState from "vuex-persistedstate"

export default createStore({
    state    : {
        CurrentUser: '',
        IsAdmin    : false
    },
    mutations: {
        setCurrentUser(state, user) {
            state.CurrentUser = user;
        },
        setIsAdmin(state, isAdmin) {
            state.IsAdmin = isAdmin;
        },
    },
    getters  : {
        CurrentUser: (state) => state.CurrentUser,
    },
    actions  : {},
    modules  : {},
    plugins  : [createPersistedState()]
})
